﻿Public Class PhieuThueDAO
    Dim connect As New connect()
    Public Function GetData() As List(Of PhieuThueDTO)
        Dim i As Integer
        Dim MaPT, MaKH, MaTD, GiaThue, MaDV, BiXoa As String
        Dim NgayThue As DateTime
        Dim PhieuThueDTO As PhieuThueDTO
        Dim PhieuThueList As New List(Of PhieuThueDTO)
        Dim dt As New DataTable
        dt = connect.GetData("select * from PHIEUTHUE")

        For i = 0 To dt.Rows.Count() - 1
            MaPT = dt.Rows(i)("MAPT").ToString()
            MaKH = dt.Rows(i)("MAKH").ToString()
            NgayThue = dt.Rows(i)("NGAYTHUE")
            MaTD = dt.Rows(i)("MATD").ToString()
            GiaThue = dt.Rows(i)("GIATHUE").ToString()
            MaDV = dt.Rows(i)("MADV").ToString()
            BiXoa = dt.Rows(i)("BIXOA").ToString()

            PhieuThueDTO = New PhieuThueDTO(MaPT, MaKH, NgayThue, MaTD, GiaThue, MaDV, BiXoa)
            PhieuThueList.Add(PhieuThueDTO)
        Next
        Return PhieuThueList
    End Function
End Class
